package kgc.crm.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
    * 商机产品关系表
    */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "kgc_crm_crm_business_product")
public class BusinessProduct {
    @TableId(value = "r_id", type = IdType.AUTO)
    private Integer rId;

    /**
     * 商机ID
     */
    @TableField(value = "business_id")
    private Integer businessId;

    /**
     * 产品ID
     */
    @TableField(value = "product_id")
    private Integer productId;

    /**
     * 产品单价
     */
    @TableField(value = "price")
    private BigDecimal price;

    /**
     * 销售价格
     */
    @TableField(value = "sales_price")
    private BigDecimal salesPrice;

    /**
     * 数量
     */
    @TableField(value = "num")
    private Integer num;

    /**
     * 折扣
     */
    @TableField(value = "discount")
    private BigDecimal discount;

    /**
     * 小计（折扣后价格）
     */
    @TableField(value = "subtotal")
    private BigDecimal subtotal;

    /**
     * 单位
     */
    @TableField(value = "unit")
    private String unit;

    public static final String COL_R_ID = "r_id";

    public static final String COL_BUSINESS_ID = "business_id";

    public static final String COL_PRODUCT_ID = "product_id";

    public static final String COL_PRICE = "price";

    public static final String COL_SALES_PRICE = "sales_price";

    public static final String COL_NUM = "num";

    public static final String COL_DISCOUNT = "discount";

    public static final String COL_SUBTOTAL = "subtotal";

    public static final String COL_UNIT = "unit";
}